﻿namespace PmSoft.Quartz;

/// <summary>
/// 任务描述
/// </summary>
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public class JobDescriptionAttribute : Attribute
{
    public JobDescriptionAttribute()
    {
    }

    public JobDescriptionAttribute(string cronExpression)
    {
        CronExpression = cronExpression;
    }

    public JobDescriptionAttribute(string cronExpression, RunAtServer atServer)
    {
        CronExpression = cronExpression;
        AtServer = atServer;
    }

    /// <summary>
    /// 在哪个服务器上运行
    /// </summary>
    public RunAtServer AtServer { get; set; } = RunAtServer.Any;

    /// <summary>
    /// Quartz任务时间规则
    /// </summary>
    public string CronExpression { get; set; }
}